package stackoverflow.domain.question.specification;

import java.util.Set;

import stackoverflow.domain.question.Question;
import stackoverflow.domain.question.Tag;


public class QuestionTagSpecification implements QuestionSpecification
{
	Set<Tag> tags;
	
	public QuestionTagSpecification(Set<Tag> tags)
	{
		this.tags=tags;
	}

	public boolean isSatisfiedBy(Question question)
	{
		for (Tag tag : question.getTags())
		{
			if(tags.contains(tag))
				return true;
		}
		return false;
	}

}
